<template>
  <div class="card-tag-cloud">
    <a class="tag-item" style="font-size:1em" href="javascript:void(0);" v-for="(tag , index) in top20Tags" :key="index"
       :title="tag.content" @click="toPath('tags?id=' + tag.id)">
      {{ tag.content }}<sup>{{ tag.mark }}</sup>
    </a>
  </div>
</template>

<script setup>
import {computed} from "vue";
import {useRouter} from 'vue-router';
import store from "../../store/index.js";

const router = useRouter();
const tagList = computed(() => store.state.data.consoleTagList);
const top20Tags = computed(() => tagList.value.slice(0, 20));

const handleClick = () => {
  console.log("点击了");
}

const toPath = (path) => {
  router.push(path)
}
</script>

<style scoped>
</style>
